module grpc.Interface;

import std.array;
import grpc;
import google.protobuf;
import hunt.logging;
import message.MsgDefine;

  //class GreeterClient
  //{
  //  this(Channel channel)
  //  {
  //    _channel = channel;
  //  }
  //
  //  HelloReply SayHello( HelloRequest request)
  //  {
  //    mixin(CM!(HelloReply , GreeterBase.SERVICE));
  //  }
  //
  //  void SayHello( HelloRequest request , void delegate(Status status , HelloReply response) dele)
  //  {
  //    mixin(CMA!(HelloReply , GreeterBase.SERVICE));
  //  }
  //
  //  HelloReply SayGoodBye( HelloRequest request)
  //  {
  //    mixin(CM!(HelloReply , GreeterBase.SERVICE));
  //  }
  //
  //  void SayGoodBye( HelloRequest request , void delegate(Status status , HelloReply response) dele)
  //  {
  //    mixin(CMA!(HelloReply , GreeterBase.SERVICE));
  //  }
  //
  //
  //  private:
  //  Channel _channel;
  //}

class AuthorizeExecutor: GrpcService
{
  enum SERVICE  = "grpc.AuthorizeExecutor";
  string getModule()
  {
    return SERVICE;
  }

  Status authorize(AuthenticateREQ , ref AuthenticateRES){
    return Status.OK;
  }

  Status process(string method , GrpcStream stream, ubyte[] complete)
  {
    switch (method)
    {
      mixin(SM!(AuthenticateREQ , AuthenticateRES , "authorize"));
      mixin(NONE());
    }
  }
}

